<#include "base.ftl"/>

<#macro title>
航运交易及实时监控系统
</#macro>
<#macro cssfile>
</#macro>
	      
<#macro scriptfile>
</#macro>
<#macro jsscript>
  $(function(){
      $("#logisticsSupplyId").ready(function(){
          $.ajax({
              url: '${request.contextPath}/list/content/TltLogisticsSupply/list.html', 
    	      type:'post',
              data:{},
              dataType : 'json',
              success:function(data){
        	      $(data.page.result).each(function(index, obj){ 
        	    	  $("#id"+index).val(obj.LSINFO_ID);
        		 //var data1 = eval("("+ data+")");
        		 //alert(data1); 
        		 //$("#content").append(u.title+"</br>");
        		 //alert(obj.CURRENT_ADDRESS);
        		  $("#adrass"+index).html(obj.CURRENT_ADDRESS);
        		  $("#gorss"+index).html(obj.MAX_LOAD_WEIGHT);
        		  $("#transportMode"+index).html(obj.TRANSPORT_MODE);
        		  $("#planDestination"+index).html(obj.PLAN_DESTINATION);
        		  $(obj.CURRENT_ADDRESS).each(function(index, value){
        			 alert(value);
        		  })
        	      }) 
               },
             'error':function(xhr,e1,e2){
    	             alert("没有sql语句");
               }
           });
      });
 
      $("#logisticsDemandId").ready(function(){
           $.ajax({
 		       url: '${request.contextPath}/list/content/TltLogistDemand/list.html', 
    	       type:'post',
               data:{},
               dataType : 'json',
               success:function(data){
        	       $(data.page.result).each(function(index, obj){ 
        		 //var data1 = eval("("+ data+")");
        		 //alert(data1); 
        		 //$("#content").append(u.title+"</br>");
        		 
        		 //alert(obj.CURRENT_ADDRESS);
        		   $("#idid"+index).val(obj.LDINFO_ID);
        		   //detailedId2=$("#id2").val();
        		   
        		   //alert(detailedId);
        		   $("#adrasss"+index).html(obj.DISPATCH_ADDRESS);
        		   //alert(a);
        		   $("#gorsss"+index).html(obj.CARGO_WEIGHT);
        		   $("#transportModee"+index).html(obj.TRANSPORT_MODE);
        		   $("#planDestinationn"+index).html(obj.DESTINATION);
        		   $(obj.CURRENT_ADDRESS).each(function(index, value){
        			 alert(value);
        		   })
        	       }) 
                },
              'error':function(xhr,e1,e2){
    	          alert("没有sql语句");
              }
         });
    
      });
      $("#storageSupplyId").ready(function(){
      $.ajax({
 		  url: '${request.contextPath}/list/content/TltStorageSupply/list.html', 
    	  type:'post',
          data:{},
          dataType : 'json',
          success:function(data){
        	     $(data.page.result).each(function(index, obj){ 
          		   $("#storageSupply"+index).val(obj.SSINFO_ID);
        		 //var data1 = eval("("+ data+")");
        		 //alert(data1); 
        		 //$("#content").append(u.title+"</br>");
        		 
        		 //alert(obj.CURRENT_ADDRESS);
        		 
        		 $("#warehouseAddress"+index).html(obj.WAREHOUSE_ADDRESS);
        		 $("#warehouseQualification"+index).html(obj.WAREHOUSE_QUALIFICATION);
        		 $("#availableVolume"+index).html(obj.AVAILABLE_VOLUME);
        		 $(obj.CURRENT_ADDRESS).each(function(index, value){
        			 alert(value);
        		 })
                 }) 
          },
         'error':function(xhr,e1,e2){
    	    alert("没有sql语句");
         }
      });
    
    });
    $("#storageDemandId").ready(function(){
        $.ajax({
 		    url:'${request.contextPath}/list/content/TltStorageDemand/list.html',
    	    type:'post',
            data:{},
            dataType :'json',
            success:function(data){
        	    $(data.page.result).each(function(index, obj){ 
           		   $("#storageDemandId"+index).val(obj.SDINFO_ID);
        		 $("#cargoAddress"+index).html(obj.CARGO_ADDRESS);
        		 $("#cargoType"+index).html(obj.CARGO_TYPE);
        		 $("#cargoVolume"+index).html(obj.CARGO_VOLUME);
        		 $(obj.CURRENT_ADDRESS).each(function(index, value){
        			 alert(value);
        		 })
        	     }) 
             },
            'error':function(xhr,e1,e2){
    	           alert("没有sql语句");
            }
       });
    
    });
    addressInit('cmbProvince', 'cmbCity', 'cmbArea', '直辖市', '北京市', '朝阳区');
 	addressInit('Select1', 'Select2', 'Select3','直辖市', '上海市', '天河区');
    addressInit('province', 'city', 'area', '直辖市', '北京市', '朝阳区');
    addressInit('province1', 'city1', 'area1','直辖市', '上海市', '天河区');
    $("#arriveTime").removeAttr().val("");
 });
          $('#submit').click(function(){
        	  /*var options=$("#optionsRadio input");
        	  var option;
        	  var transport;
        	  var cmbCity;
        	  var arriveCity;
        	  var time;
        	  for(var i=0;i<options.length;i++){
        		  if(options[i].checked){
        			  option=options[i].value;
        			  //alert(option);
        		  }
        	  }
        	   	alert(option);
        	  if(option==("供应")){
        		  transport=$("#transport").val();
        		  cmbCity=$("#cmbCity").val();
        		  arriveCity=$("#Select2").val();
        		  //alert(arriveCity);
        		  time=$("#time").val();
        		  //alert(time);
        		  var arr=new Array(option,cmbCity,arriveCity,time,transport);
        		  //alert(arr);
        		  $.ajax({
                      url: '${request.contextPath}/list/content/TltLogisticsSupply/list.html', 
                      type:'post',
                      data:{"_search":true,"filters":'{"groupOp":"AND","rules":[{"field":"CURRENT_ADDRESS","op":"cn","data":"'+cmbCity+'"},{"field":"PLAN_DESTINATION","op":"cn","data":"'+arriveCity+'"}]'},
                      dataType : 'json',
                      success:function(data){
                	      $(data.page.result).each(function(index, obj){ 
                		  $("#adrass"+index).html(obj.CURRENT_ADDRESS);
                		  $("#gorss"+index).html(obj.MAX_LOAD_WEIGHT);
                		  $("#transportMode"+index).html(obj.TRANSPORT_MODE);
                		  $("#planDestination"+index).html(obj.PLAN_DESTINATION);
                	      }) 
                       },
                     'error':function(xhr,e1,e2){
            	             alert("没有sql语句");
                       }
                   });*/
        	  var url = "content/classify.html";
        		var storageTransport = $("#storageTransport").val();
        		var storageOptions=$("#optionsRadioo input");
        		var optionn;
        		for(var i=0;i<storageOptions.length;i++){
        			  if(storageOptions[i].checked){
        				  optionn=storageOptions[i].value;
        				  //alert(option);
        			  }
        		  }
        		 //alert(optionn);
        		  var city=$("#city").val();
        		  alert(city);
        		  var city1=$("#city1").val();
        		  var arriveDate=$("#arriveDate").val();
        		  //alert(city1);
        		 // alert(arriveDate);
        		  //alert(storageTransport);
        		optionn = encodeURI(encodeURI(optionn));
        		city = encodeURI(encodeURI(city));
        		city1 = encodeURI(encodeURI(city1));
        		arriveDate = encodeURI(encodeURI(arriveDate));
        		storageTransport = encodeURI(encodeURI(storageTransport));
        		//alert(storageTransport);
        		window.open(url + "?storageTransport="+ storageTransport+"&arriveDate="+arriveDate+"&city="+city+"&city1="+city1+"&optionn="+optionn); 
        	})
        	  /*}else if(option==("需求")){
        		  var transport=$("#transport").val();
        		  var cmbCity=$("#cmbCity").val();
        		  var arriveCity=$("#Select2").val();
        		  alert(arriveCity);
        		  var time=$("#time").val();
        		  //alert(time);
        		  var arr=new Array(option,transport,cmbCity,arriveCity,time);
        		  alert(arr);
        	  }else{
        		  var transport=$("#transport").val();
        		  var cmbCity=$("#cmbCity").val();
        		  var arriveCity=$("#Select2").val();
        		  //alert(arriveCity);
        		  var time=$("#time").val();
        		  var arr=new Array(transport,cmbCity,arriveCity,time);
        		  alert(arr);
        	  }
          })*/
	
$('#search').click(function(){
	var url = "content/classify.html";
	var transport = $("#transport").val();
	var options=$("#optionsRadio input");
	var option;
	for(var i=0;i<options.length;i++){
		  if(options[i].checked){
			  option=options[i].value;
			  //alert(option);
		  }
	  }
	  //alert(option);
	  var cmbCity=$("#cmbCity").val();
	  //alert(cmbCity);
	  var select2=$("#Select2").val();
	  var arriveTime=$("#arriveTime").val();
	  //alert(select2);
	  //alert(arriveTime);
	  //alert(transport);
	option = encodeURI(encodeURI(option));
	cmbCity = encodeURI(encodeURI(cmbCity));
	select2 = encodeURI(encodeURI(select2));
	arriveTime = encodeURI(encodeURI(arriveTime));
	transport = encodeURI(encodeURI(transport));
	//alert(transport);
	window.open(url + "?transport="+ transport+"&option="+option+"&cmbCity="+cmbCity+"&select2="+select2+"&arriveTime="+arriveTime); 
})

function view(curr){
    var a=curr.id;
    //alert(a);
    if(a.length==3){
    	var url="template/logisticsSupply/detail.html";
    	 var c = a.substring(2,3);
    	    //alert(c);
    	      var b=$("#id" + c).val();
    	    window.open(url + "?lsinfoId="+ b); 
    }else if(a.length==5){
        var url = "template/logisticsDemand/detail.html";
    var c = a.substring(4,5);
      var b=$("#idid" + c).val();
      //alert(b);
    window.open(url + "?ldinfoId="+ b); 
    }else if(a.length==14){
    	var url="template/storageSupply/detail.html";
    	var c=a.substring(13,14);
    	//alert(c);
    	var b=$("#storageSupply"+c).val();
    	//alert(b);
        window.open(url + "?ldinfoId="+ b); 
     }else{
        	  var url="template/storageDemand/detail.html";
        	  var c=a.substring(15,16);
             // alert(c);
              var b=$("#storageDemandId"+c).val();
              //alert(b);
              window.open(url + "?ldinfoId="+ b); 
          }
          }
          
</#macro>

<#macro main>
    <div>
       <table class="table table-bordered">
         <tbody>
             <tr>
                <td>
                  <label class="control-label">物流供求</label>
                  <div id="optionsRadio">
                    <label class="checkbox inline">类型：</label>
                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="供应"checked>&nbsp;供应
                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="需求">&nbsp;需求
                  </div>
                  <div>
                    <label class="checkbox inline">城市：</label>
                                                                       从&nbsp;&nbsp;
                         <select name="zy" class="span2" id="cmbProvince">
                         
                                       </select>&nbsp;&nbsp;省/直辖市&nbsp;&nbsp;
                                                                        
                        <select name="zy" class="span2" id="cmbCity">
                                       </select> 
                                     &nbsp;&nbsp;  
                       <select name="zy" class="span1" id="cmbArea" style="visibility:hidden">
                                       </select>
                                       
                   </div>
                    &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;到：
                        <select name="zy" class="span2" id="Select1">
                                       </select>&nbsp;&nbsp;省/直辖市&nbsp;&nbsp;
                        <select name="zy" class="span2" id="Select2">
                                       </select>
                                                                      
                       <select name="zy" class="span1" id="Select3" style="visibility:hidden">
                                       </select>
                   <div>
                       <label class="checkbox inline">到达日期：</label>
                            <input id="arriveTime" class="Wdate" type="text" onFocus="WdatePicker()"/>
                            <span id="time1" style="color:red"></span>
                   </div>
                   <div>
                     <label class="checkbox inline">运输方式：</label>
                     <select class="input-xlarge" style="width:200px;" id="transport">
                            <option>水运</option>
                            <option>陆运</option>
                            <option>空运</option>
                        </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <span><a class="btn btn-primary" style="margin-left:10px" id="search">搜索 &raquo;</a></span>
                   </div>
                </td>
                <td>
                  <label class="control-label">仓储供求</label>
                  <div id="optionsRadioo">
                    <label class="checkbox inline">类型：</label>
                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="供应">&nbsp;供应
                    <input type="radio" name="optionsRadios" id="optionsRadios4" value="需求">&nbsp;需求
                  </div>
                  <div>
                    <label class="checkbox inline">城市：</label>
                                                                                      从&nbsp;&nbsp;
                         <select name="zy" class="span2" id="province">
                                       </select>&nbsp;&nbsp;省/直辖市&nbsp;&nbsp;
                        <select name="zy" class="span2" id="city">
                                       </select> 
                                     &nbsp;&nbsp; 
                       <select name="zy" class="span1" id="area" style="visibility:hidden">
                                       </select>
                                       
                   </div>
                       &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  到：<select name="zy" class="span2" id="province1">
                                       </select>&nbsp;&nbsp;省/直辖市&nbsp;&nbsp;
                        <select name="zy" class="span2" id="city1">
                                       </select>
                                                                      
                       <select name="zy" class="span1" id="area1" style="visibility:hidden">
                                       </select>
                   <div>
                       <label class="checkbox inline">到达日期：</label>
                            <input id="arriveDate" class="Wdate" type="text" onFocus="WdatePicker()"/>
                            <span id="time1" style="color:red"></span>
                   </div>
                   <div>
                     <label class="checkbox inline">运输方式：</label>
                     <select class="input-xlarge" style="width:200px;" id="storageTransport">
                            <option>水运</option>
                            <option>陆运</option>
                            <option>空运</option>
                        </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <span><input class="btn btn-primary" type="button" value="搜索" id="submit"></span>
                   </div>

                </td>
             </tr>

         </tbody>


       </table>
    
    
    
    </div>
    
    
    <div>
          <div class="row-fluid">
            <div class="span6">
              <span style="font-size: 23.5px;">物流供应信息</span>
              <p class="pull-right"><a class="btn btn-success" href="template/logisticsSupply/input.html">我要发布&raquo;</a><a class="btn" style="margin-left:10px" href="content/classify.html">更多 &raquo;</a></p>
              <table class="table table-bordered" id="logisticsSupplyId">
              <thead>
                <tr>
                 <th>编号</th>
                  <th>出发地</th>
                  <th>目的地</th>
                  <th>运输方式</th>
                  <th>可载重量</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <tr id="kkk">
                  <td>1</td>
                  <td id="adrass0" align="center"></td>
                  <td id="planDestination0"></td>
                  <td id="transportMode0"></td>
                  <td id="gorss0"></td>
                  <td><a id="id0" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>2</td>
                  <td id="adrass1" align="center"></td>
                  <td id="planDestination1"></td>
                  <td id="transportMode1"></td>
                  <td id="gorss1"></td>
                  <td><a id="id1" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>3</td>
                  <td id="adrass2"></td>
                  <td id="planDestination2"></td>
                  <td id="transportMode2"></td>
                  <td id="gorss2"></td>
                  <td><a id="id2" onClick="view(this);">[查看]</a></td>
                </tr>
				<tr>
                  <td>4</td>
                  <td id="adrass3"></td>
                  <td id="planDestination3"></td>
                  <td id="transportMode3"></td>
                  <td id="gorss3"></td>
                  <td><a id="id3" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>5</td>
                  <td id="adrass4"></td>
                  <td id="planDestination4"></td>
                  <td id="transportMode4"></td>
                  <td id="gorss4"></td>
                  <td><a id="id4" onClick="view(this);">[查看]</a></td>
                </tr>
              </tbody>
            </table>
              
            </div><!--/span-->
            <div class="span6">
              <span style="font-size: 23.5px;">物流需求信息</span>
              <p class="pull-right"><a class="btn btn-success" href="template/logisticsDemand/input.html">我要发布&raquo;</a><a class="btn" style="margin-left:10px" href="content/classify.html">更多 &raquo;</a></p>
              <table class="table table-bordered" id="logisticsDemandId">
              <thead>
                <tr>
                  <th>编号</th>
                  <th>出发地</th>
                  <th>目的地</th>
                  <th>运输方式</th>
                  <th>货物重量</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <tr id="kkk">
                  <td>1</td>
                  <td id="adrasss0" align="center"></td>
                  <td id="planDestinationn0"></td>
                  <td id="transportModee0"></td>
                  <td id="gorsss0"></td>
                  <td><a id="idid0"onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>2</td>
                  <td id="adrasss1" align="center"></td>
                  <td id="planDestinationn1"></td>
                  <td id="transportModee1"></td>
                  <td id="gorsss1"></td>
                  <td><a id="idid1" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>3</td>
                  <td id="adrasss2"></td>
                  <td id="planDestinationn2"></td>
                  <td id="transportModee2"></td>
                  <td id="gorsss2"></td>
                  <td><a id="idid2" onClick="view(this);">[查看]</a></td>
                </tr>
				<tr>
                  <td>4</td>
                  <td id="adrasss3"></td>
                  <td id="planDestinationn3"></td>
                  <td id="transportModee3"></td>
                  <td id="gorsss3"></td>
                  <td><a id="idid3" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>5</td>
                  <td id="adrasss4"></td>
                  <td id="planDestinationn4"></td>
                  <td id="transportModee4"></td>
                  <td id="gorsss4"></td>
                  <td><a id="idid4" onClick="view(this);">[查看]</a></td>
                </tr>
              </tbody>
            </table>
              
            </div><!--/span-->
         
        </div><!--/span-->
        
         <div class="row-fluid">
            <div class="span6">
              <span style="font-size: 23.5px;">仓储供应信息</span>
              <p class="pull-right"><a class="btn btn-success" href="template/storageSupply/input.html">我要发布&raquo;</a><a class="btn" style="margin-left:10px" href="content/classify.html">更多 &raquo;</a></p>
              <table class="table table-bordered" id="storageSupplyId">
              <thead>
               <tr>
                 <th>编号</th>
                  <th>仓库所在地</th>
                  <th>仓库资质</th>
                  <th>可用容量</th>
                  <th>操作</th>	
                </tr>
              </thead>
              <tbody>
                 <tr id="kkkk">
                  <td>1</td>
                  <td id="warehouseAddress0"></td>
                  <td id="warehouseQualification0"></td>
                  <td id="availableVolume0"></td>
                  <td><a id="storageSupply0" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>2</td>
                  <td id="warehouseAddress1"></td>
                  <td id="warehouseQualification1" align="center"></td>
                  <td id="availableVolume1"></td>
                  <td><a id="storageSupply1" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>3</td>
                  <td id="warehouseAddress2"></td>
                  <td id="warehouseQualification2"></td>
                  <td id="availableVolume2"></td>
                  <td><a id="storageSupply2" onClick="view(this);">[查看]</a></td>
                </tr>
				<tr>
                  <td>4</td>
                  <td id="warehouseAddress3"></td>
                  <td id="warehouseQualification3"></td>
                  <td id="availableVolume3"></td>
                  <td><a id="storageSupply3" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>5</td>
                  <td id="warehouseAddress4"></td>
                  <td id="warehouseQualification4"></td>
                  <td id="availableVolume4"></td>
                  <td><a id="storageSupply4" onClick="view(this);">[查看]</a></td>
                </tr>
              </tbody>
            </table>
              
            </div><!--/span-->
            <div class="span6">
              <span style="font-size: 23.5px;">仓储需求信息</span>
              <p class="pull-right"><a class="btn btn-success" href="template/storageDemand/input.html">我要发布&raquo;</a><a class="btn" style="margin-left:10px" href="content/classify.html">更多 &raquo;</a></p>
              <table class="table table-bordered" id="storageDemandId">
              <thead>
                <tr>
                  <th>编号</th>
                  <th>货物所在地</th>
                  <th>货物类型</th>
                  <th>货物体积</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>1</td>
                  <td id="cargoAddress0"></td>
                  <td id="cargoType0"></td>
                  <td id="cargoVolume0"></td>
                  <td><a id="storageDemandId0" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>2</td>
                  <td id="cargoAddress1"></td>
                  <td id="cargoType1"></td>
                  <td id="cargoVolume1"></td>
                  <td><a id="storageDemandId1" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>3</td>
                  <td id="cargoAddress2"></td>
                  <td id="cargoType2"></td>
                  <td id="cargoVolume2"></td>
                  <td><a id="storageDemandId2" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>4</td>
                  <td id="cargoAddress3"></td>
                  <td id="cargoType3"></td>
                  <td id="cargoVolume3"></td>
                  <td><a id="storageDemandId3" onClick="view(this);">[查看]</a></td>
                </tr>
                <tr>
                  <td>5</td>
                  <td id="cargoAddress4"></td>
                  <td id="cargoType4"></td>
                  <td id="cargoVolume4"></td>
                  <td><a id="storageDemandId4" onClick="view(this);">[查看]</a></td>
                </tr>
              </tbody>
            </table>
            <span id="ssspan1"></span>
            </div><!--/span-->
           
          </div><!--/row-->
        </div><!--/row-->
</#macro>
